﻿namespace DeltaGroup.WheelOfJeopardy.ChallengeManager
{
    using DeltaGroup.WheelOfJeopardy.Model;

    public sealed class ResponseInterpreter
    {
        #region Fields

        InterpreterStrategy strategy;

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ResponseInterpreter"/> class.
        /// </summary>
        /// <param name="level">The level.</param>
        public ResponseInterpreter(DifficultyLevel level)
        {
            strategy = InterpreterStrategy.CreateStrategy(level);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ResponseInterpreter"/> class.
        /// </summary>
        private ResponseInterpreter()
        {
        }

        #endregion Constructors

        #region Methods

        /// <summary>
        /// Evaluates the response.
        /// </summary>
        /// <param name="challenge">The challenge.</param>
        /// <param name="responseString">The response string.</param>
        /// <returns></returns>
        public bool EvaluateResponse(Challenge challenge, string responseString)
        {
            return strategy.EvaluateResponse(challenge, responseString);
        }

        #endregion Methods
    }
}